

using System;
using Abp.Application.Services.Dto;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using DualControl.HazardSources;
using DualControl.Common;
using DualControl.ControlMeasures;
using DualControl.RiskPoints;
using DualControl.EmergencyMeasures;

namespace DualControl.HazardSources.Dtos
{
    public class HazardSourceListDto : EntityDto
    {

        /// <summary>
        /// Code
        /// </summary>
        public string Code { get; set; }


        /// <summary>
        /// RiskPointId
        /// </summary>
        public int RiskPointId { get; set; }

        /// <summary>
        /// JobStep
        /// </summary>
        public string HazardSourceName { get; set; }


        /// <summary>
        /// RiskFactor
        /// </summary>
        public string RiskFactor { get; set; }


        /// <summary>
        /// PostId
        /// </summary>
        public int PostId { get; set; }


        /// <summary>
        /// AccidentType
        /// </summary>
        //public AccidentType AccidentType { get; set; }


        /// <summary>
        /// AccidentTypes
        /// </summary>
        public string AccidentTypes { get; set; }

        public List<AccidentType> AccidentTypesForView
        {

            get
            {
                string[] strarray;
                List<AccidentType> accidentlist = new List<AccidentType>();
                if (AccidentTypes.Length > 0)
                {
                    strarray = AccidentTypes.Split(" ");
                    foreach (var a in strarray)
                    {
                        accidentlist.Add((AccidentType)Convert.ToInt16(a));
                    }
                }
                return accidentlist;
            }
        }


        /// <summary>
        /// L
        /// </summary>
        public float L { get; set; }


        /// <summary>
        /// E
        /// </summary>
        public float E { get; set; }


        /// <summary>
        /// C
        /// </summary>
        public float C { get; set; }

        
        /// <summary>
        /// RiskLevel
        /// </summary>
        public RiskLevel RiskLevel { get; set; }


        /// <summary>
        /// RiskColor
        /// </summary>
        public RiskColor RiskColor { get; set; }


        /// <summary>
        /// ResponsiblePerson
        /// </summary>
        public long ResponsiblePerson { get; set; }


        /// <summary>
        /// ControlLevels
        /// </summary>
        public int ControlLevels { get; set; }


        /// <summary>
        /// ControlMeasures
        /// </summary>
        public ICollection<ControlMeasure> ControlMeasures { get; set; }

        public ICollection<EmergencyMeasure> EmergencyMeasures { get; set; }
       
    }
}